a1=[1 0 1 1]
a2=[0 1 0 1]
t1=[1 1 0 1]
t2=[0 0 1 1]